package io.renren.modules.microMajor.controller;


import io.renren.common.utils.R;
import io.renren.modules.microMajor.service.MicroMajorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("api/microMajor")
public class MicroMajorController {

    @Autowired
    MicroMajorService microMajorService;

    //@RestController
    @GetMapping("getmicroMajorList")
    public R getMarorList(Integer classification){

        List list=microMajorService.getMarorList(classification);
        return R.ok("",100).put("microMajorList",list);
    }

    @GetMapping("getMarorCourseList")
    public R getMarorCourseList(Integer microMajorId){

        List list=microMajorService.getMarorCourseList(microMajorId);
        return R.ok("",100).put("marorCourseList",list);
    }


    @GetMapping("getKang")
    public R getKang(@RequestBody Map map){
        int start = Integer.parseInt(map.get("start").toString());
        int end = Integer.parseInt(map.get("end").toString());
        Object o = microMajorService.getKang(start,end);
        return R.ok("",100);
    }
}
